package com.muxue.module.ai.model.dto.audio.speech.api;

import org.springframework.ai.model.StreamingModel;
import org.springframework.ai.openai.audio.speech.SpeechPrompt;
import org.springframework.ai.openai.audio.speech.SpeechResponse;
import reactor.core.publisher.Flux;

/**
 * @author muxue
 * @author <a href="mailto:yuluo08290126@gmail.com">yuluo</a>
 * @since 2023.0.1.0
 */

@FunctionalInterface
public interface SpeechStreamModel extends StreamingModel<SpeechPrompt, SpeechResponse> {


//	default Flux<ByteBuffer> stream(String message) {
//
//		SpeechPrompt prompt = new SpeechPrompt(message);
//		return stream(prompt).map(SpeechResponse::getResult).map(Speech::getOutput);
//	}


	@Override
	Flux<SpeechResponse> stream(SpeechPrompt prompt);

}
